package com.fafian.gdc.socket;

public class SocketMessageResponse extends SocketMessage {

	protected enum Result{
		OK, KO;
	}
	
	private Result result;
	private String explanation;
	
	public SocketMessageResponse(boolean ok, String explanation){
		super(MessageType.RESPONSE);
		this.explanation = explanation;
		if (ok)
			result = Result.OK;
		else
			result = Result.KO;
	}
	
	protected SocketMessageResponse(Result result, String explanation){
		super(MessageType.RESPONSE);
		this.explanation = explanation;
		this.result = result;
	}
	
	protected Result getResult(){
		return result;
	}
	
	public boolean isOK(){
		switch(result){
		case OK:
			return true;

		case KO:
		}
		return false;
	}
	
	public String getExplanation(){
		return explanation;
	}
	
}
